package com.asion.gankapp.adapters;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.asion.gankapp.view.fragments.BaseRecyclerFragment;

import java.util.List;

/**
 * Created by asion on 16-10-5.
 */

public class BaseViewPagerAdapter extends FragmentPagerAdapter {

    public BaseViewPagerAdapter(FragmentManager fm, List<String> list,int type) {
        super(fm);
        this.list = list;
        this.type = type;
    }

    private List<String> list;
    private int type;

    @Override
    public Fragment getItem(int position) {
        return BaseRecyclerFragment.newInstance(list.get(position),type,position+1);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return list.get(position);
    }
}
